1. Field of the Invention
The present invention relates to an electronic control unit for a vehicle and method of writing data.
2. Description of Related Art
An electronic control unit (ECU) for a vehicle is equipped with a nonvolatile memory (e.g., flash ROM (Read-Only Memory)) in which data can be written and erased electronically. The electronic control unit controls on-vehicle devices (e.g., fuel injector) by a control program or the like stored in the nonvolatile memory.
As described in Japanese Laid-Open Patent Publication No. 2008-146521, in a case in which data of a control program or the like is written into a nonvolatile memory, a writing tool for transferring write data to an electronic control unit is connected to the electronic control unit. Then, the electronic control unit writes the write data into the nonvolatile memory while transferring the write data from the writing tool.
In the meantime, the writing tool divides the overall write data by predetermined size, and transfers divided write data (divided data) sequentially to the electronic control unit. In this case, after writing transferred divided data into the nonvolatile memory, the electronic control unit performs receive processing for the next divided data. Thus, the electronic control unit alternately performs divided data writing processing and divided data receiving processing to write the overall write data into the nonvolatile memory. Therefore, the time required to write the overall write data into the nonvolatile memory is the sum of the time required for writing processing for all pieces of divided data and the time required for receiving processing for all pieces of divided data.